home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib05.dsk
/
DATE KEEPER.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
2KB
|
56 lines
1 REM DATE-KEEPER HELLO PROGRAM
2 D$ = CHR$(4): ONERR GOTO 70
3 PRINT D$"OPEN DATE"
4 PRINT D$"READ DATE"
6 INPUT DR$
8 PRINT D$"CLOSE"
9 YR$ = LEFT$(DR$,2):M$ = MID$ (DR$,3,2):DA$ = RIGHT$(DR$,2)
10 ON VAL(M$) GOSUB 51,52,53,54,55,56,57,58,59,60,61,62
11 DT$ = MO$ +" " +DA$ +",19" +YR$
12 TEXT : HOME : INVERSE : PRINT "PRESENT DATE -- ";DT$;" ";: NORMAL : PRINT :
14 POKE 216,0: POKE 1016, VAL(YR$): POKE 1017, VAL(M$): POKE 1018, VAL(DA$)
15 PRINT "TO CHANGE DATE, PRESS ";: INVERSE : PRINT "D": NORMAL : PRINT
16 PRINT "FOR A CATALOG, PRESS ";: INVERSE : PRINT "C": NORMAL : PRINT
18 PRINT "TO RETURN TO BASIC, PRESS ANY OTHER KEY.": PRINT
19 GET A$: PRINT : IF A$ = "D" THEN 30
21 IF A$ < >"C" THEN END
22 PRINT D$"CATALOG": END
30 INVERSE : PRINT "A CARRIAGE RETURN LEAVES AS ABOVE... ";: NORMAL : PRINT :
32 INPUT "ENTER MONTH NO. (1 - 12) : ";A$: IF LEN(A$) = 0 THEN 36
33 IF VAL(A$) <1 OR VAL(A$) >12 THEN 32
34 M$ = A$: IF LEN(M$) = 1 THEN M$ = "0" +M$
35 ON VAL(M$) GOSUB 51,52,53,54,55,56,57,58,59,60,61,62
36 INPUT "ENTER DAY OF MONTH (1 - 31): ";A$: IF LEN(A$) = 0 THEN 40
37 IF VAL(A$) <1 OR VAL(A$) >31 THEN 36
38 DA$ = A$: IF LEN(DA$) = 1 THEN DA$ = "0" +DA$
40 INPUT "ENTER YEAR AS 2 DIGITS : ";A$: IF LEN(A$) = 0 THEN 44
41 IF VAL(A$) <0 OR VAL(A$) >99 THEN 40
42 YR$ = A$
43 ON VAL(M$) GOSUB 51,52,53,54,55,56,57,58,59,60,61,62
44 DD$ = MO$ +" " +DA$ +", 19" +YR$
45 PRINT : PRINT "NEW DATE IS ";DD$;"..RIGHT? (Y/N)";: GET A$: PRINT A$
46 IF A$ < >"Y" GOTO 30
47 DT$ = YR$ +M$ +DA$
48 GOTO 70
50 END
51 MO$ = "JAN": RETURN
52 MO$ = "FEB": RETURN
53 MO$ = "MAR": RETURN
54 MO$ = "APR": RETURN
55 MO$ = "MAY": RETURN
56 MO$ = "JUN": RETURN
57 MO$ = "JUL": RETURN
58 MO$ = "AUG": RETURN
59 MO$ = "SEP": RETURN
60 MO$ = "OCT": RETURN
61 MO$ = "NOV": RETURN
62 MO" = "DEC":RETURN
70 PRINT D$"OPEN DATE"
72 PRINT D$"WRITE DATE"
74 PRINT DT$
76 PRINT D$"CLOSE"
78 GOTO 10
90 REM
91 REM WRITTEN BY
92 REM DON RAVEY
93 REM FEB. 1981